<template>
    <!-- 用伪类的方式加载图标字体 需要用到图标字体的div需要加iconfont样式 -->
    <div class="header">
        <div class="header-left iconfont">

        </div>
        <div class="header-input iconfont">
            <!-- <input type="text" placeholder="输入城市/景点/游玩主题"> -->
        </div>
        <div class="header-right iconfont" @click="selectCity">{{ this.city }}</div>
    </div>
</template>

<script>
import { mapState } from 'vuex'
export default {
    name: 'HomeHeader',
    computed: {
        ...mapState(['city'])
    },
    methods: {
        selectCity() {
            this.$router.push({
                path: '/city'
            })
        }
    }
}
</script>

<style lang="scss" scoped>
@import '~styles/varibles.scss';
@import '~styles/mixin.scss';
.header{
    display: flex;
    line-height: $headerHeight;
    background: $bgColor;
    color: #fff;
    .header-left{
        width: 0.64rem;
        float: left;
        text-align: center;
        font-size: 0.20rem;
        &:after {
            content: "\e658";
            text-align: center;
            font-size: .4rem;
        }
    }
    .header-input{
        flex: 1;
        height: 0.64rem;
        line-height: 0.64rem;
        margin-top: 0.12rem;
        background: #fff;
        border-radius: 0.1rem;
        margin-left: 0.2rem;
        padding-left: 0.2rem;
        color: #ccc;
        &:after {
            content: "\e63c";
        }
    }
    .header-right{
        float: right;
        min-width: 1.04rem;
        text-align: center;
        color: #fff;
        padding-left: 0.1rem;
        // @include ellipsis();
        font-size: 0.28rem;
        &:after {
            content: "\e65c";
            font-size: 0.34rem;
            // margin-left: -0.1rem;
        }
    }
}
</style>
